﻿// Copyright 2009 Mike Geise
// 
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// 
//     http://www.apache.org/licenses/LICENSE-2.0
// 
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

namespace Falcon.Core.Domain.Services
{
	using System.Collections.Generic;
	using Falcon.Core.Collections;
	using Falcon.Core.Domain.Values;

	public interface ISettingService
	{
		/// <summary>
		/// Gets the setting by the specified specification.
		/// </summary>
		/// <param name="specification">The <see cref="SettingSpecification"/>.</param>
		Setting GetBy(SettingSpecification specification);

		/// <summary>
		/// Gets the setting by id.
		/// </summary>
		/// <param name="id">The id.</param>
		Setting GetById(int id);

		/// <summary>
		/// Gets all the settings.
		/// </summary>
		IList<Setting> GetAll();

		/// <summary>
		/// Gets all the settings by the specified specification.
		/// </summary>
		/// <param name="specification">The <see cref="SettingSpecification"/>.</param>
		IPagedList<Setting, SettingSpecification> GetPaged(SettingSpecification specification);

		/// <summary>
		/// Creates the setting.
		/// </summary>
		Setting Create();

		/// <summary>
		/// Initializes this instance.
		/// </summary>
		void Init();

		/// <summary>
		/// Rebuilds this instance.
		/// </summary>
		void Rebuild();

		/// <summary>
		/// Inserts the specified setting.
		/// </summary>
		/// <param name="setting">The <see cref="Setting"/>.</param>
		void Insert(Setting setting);

		/// <summary>
		/// Inserts the specified setting.
		/// </summary>
		/// <param name="setting">The setting.</param>
		/// <param name="value">The value.</param>
		void Insert(Setting setting, SettingCreate value);

		/// <summary>
		/// Updates the specified setting.
		/// </summary>
		/// <param name="setting">The <see cref="Setting"/>.</param>
		void Update(Setting setting);

		/// <summary>
		/// Updates the specified setting.
		/// </summary>
		/// <param name="setting">The setting.</param>
		/// <param name="value">The value.</param>
		void Update(Setting setting, SettingUpdate value);

		/// <summary>
		/// Deletes the specified setting.
		/// </summary>
		/// <param name="setting">The <see cref="Setting"/>.</param>
		void Delete(Setting setting);
	}
}